<?php
get_header(); ?>
    <div id="content">
        <div id="LayoutColumn2" class="Content Wide WideWithRight Blog">
            <h1>Blog</h1>
            <?php
            $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
            if($paged == 1):
                $newpost = new WP_Query();
                $newpost->query('showposts=1');
                while($newpost->have_posts()): $newpost->the_post();

                ?>
                <div id="NewsContent" class="Block">
                    <h1 class="PostTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
                    <div class="BlockContent">
                        <p style="margin: 0; color:#6e6e6e;" class="NewsDate">
                            Ngày đăng : <span><?php the_date(); ?></span>
                        </p>
                        <div class="PostBody">
                            <?php the_content('', true); ?>
                        </div>
                    </div>
                </div>
                <?php
                endwhile;
            endif;
            ?>
            <?php
                if (is_page('blog')) {
                    query_posts("offset=1&cat=3&paged=$paged");
                }
            ?>
            <?php if (have_posts()): ?>
            <?php while (have_posts()) : the_post();?>
                <div class="BlogPostContent">
                    <div class="bfc">
                        <h3><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h3>
                        <p>
                            <?php the_content("[...]")?>
                        </p>
                        <p><a href="<?php the_permalink();?>">Read More »</a></p>
                    </div>
                </div><!--end .BlogPostContent-->
            <?php endwhile; endif; ?>
                
            <div class="product-nav btm">
                <div id="CategoryPagingBottom" class="Block Moveable Panel PagingBottom">            
                    <div class="CategoryPagination BloggingPagination">
                        <div class="FloatLeft">

                        </div>
<!--                        <div class="FloatRight">
                            <a href="?page=2">Next »</a>
                        </div>-->
                        <div class="pagination">
                            <ul class="PagingList">
                                <?php wp_pagenavi(); ?>
    <!--                            <li class="ActivePage">1</li><li><a href="?page=2">2</a></li>-->
                            </ul>
                        </div>
                    </div>
                </div>
                <br class="Clear">
            </div>
        </div>
        <div id="LayoutColumn1" class="Right">
            <div id="BlogRecentPosts" class="Block BrandList Moveable Panel">
                <h2>Recent Posts</h2>
                <div class="BlockContent">
                    <?php echo do_shortcode('[display-posts]'); ?>
                </div>
            </div>
        </div>
        <br class="Clear">
    </div><!--end .content-->
    <?php get_sidebar(); ?>
<?php get_footer(); ?>